import Vue from 'vue'; //引入vue对象
import VueRouter from 'vue-router';//引入路由的对象


// 告诉Vue使用VueRouter
Vue.use(VueRouter);
// 定义路由配置
const routes = [
  {
    path: '/',
    redirect: '/LoginPage'
  },
  {
    path: '/LoginPage',
    name: 'LoginPage', 
    component: () => import('../components/LoginPage.vue')
  },
  {
    path:'/IndexPage',
    name:'IndexPage',
    component:()=>import('../components/IndexPage.vue'),
     children: [
      {
        path: '', 
        name: 'IndexShouye',
        component: () => import('../components/IndexShouye.vue')
      },
      {
        path:'/PharmaceuticalCompanies',
        name:'PharmaceuticalCompanies',
        component: () => import('../components/PharmaceuticalCompanies.vue')
      },
      {
        path:'/PlaceOfSale',
        name:'PlaceOfSale',
        component: () => import('../components/PlaceOfSale.vue')
      },
      {
        path:'/CityInformation',
        name:'CityInformation',
        component: () => import('../components/CityInformation.vue')
      },
      {
        path:'/DrugInformation',
        name:'DrugInformation',
        component: () => import('../components/DrugInformation.vue')
      },
      {
        path:'/MedicalInsurancePolicy',
        name:'MedicalInsurancePolicy',
        component: () => import('../components/MedicalInsurancePolicy.vue')
      },
      {
        path:'/DoctorInformation',
        name:'DoctorInformation',
        component: () => import('../components/DoctorInformation.vue')
      },
      {
        path:'/RequiredMaterials',
        name:'RequiredMaterials',
        component: () => import('../components/RequiredMaterials.vue')
      },
      {
        path:'/MapDemo',
        name:'MapDemo',
        component: () => import('../components/MapDemo.vue')
      },
      {
        path:'/BaiduMap',
        name:'BaiduMap',
        component: () => import('../components/BaiduMap.vue')
      }
     ]
  }
];
  // 创建router实例，然后传入`routes`配置
  const router = new VueRouter({
    mode: 'history', // 使用HTML5 History模式
    routes // (缩写) 相当于 routes: routes
  });
  export default router;
